package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.*;

//@Mapper
public interface UserMapper {
    /**
     * 增加
     */
    @Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
    @Insert("insert into tb_user(name,city) values(#{name},#{city})")
    int insert(User user);

    /**
     * 修改
     */
    @Update("update tb_user set name=#{name} where id=#{id}")
    int update(User user);

    /**
     * 删除
     */
    @Delete("delete from tb_user where id=#{id}")
    int delete(Integer id);

    /**
     * 查询
     */
    @Select("select * from tb_user where id=#{id}")
    User info(Integer id);


}
